<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../0js/vue.js"></script>
</head>
<body>

<div id="root">
    <h2>欢迎来到 {{name}}</h2>
    <button v-on:click="showInfo1">点我提示信息</button>
    <button @click="showInfo2(66,$event)">点我提示信息</button>
</div>

<script type="text/javascript">
    // 阻止vue在启动时生成生产提示
    Vue.config.productionTip = false

    const vm = new Vue({
        el:"#root",
        data: {
            name: "vue"
        },
        methods: {
            /*showInfo1(event) {
                console.log(event.target.innerText)
            },*/
            showInfo1(event) {

            },
            showInfo2(number,event) {
                console.log(this)
                console.log(event)
            }
        }
    });

</script>
</body>
</html>